package com.cyz.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author 陈雅珠
 * 首页控制器
 */
@Controller
@RequestMapping("/Index")
public class Index {

	@Resource(name="mv")
	private ModelAndView mv;
	
	/**
	 * 首页
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping("/index")
	public ModelAndView index(HttpServletRequest request,HttpServletResponse response) {
		mv.setViewName("index");
		return mv;
	}
	
	/**
	 * 后台的index页面 
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping("/adminIndex")
	public ModelAndView adminIndex(HttpServletRequest request,HttpServletResponse response) {
		mv.setViewName("admin/index");
		return mv;
	};

}
